//
//  UIButton+Extension.swift
//  WeiBo(Swift)
//
//  Created by 周成龙 on 16/9/21.
//  Copyright © 2016年 ZCL. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(imageName: String, backgroundImageName: String) {
        
        self.init()
        setImage(UIImage(named: imageName), for: UIControlState.normal)
        setImage(UIImage(named: imageName+"_highlighted"), for: UIControlState.highlighted)
        
        setBackgroundImage(UIImage(named: backgroundImageName), for: UIControlState.normal)
        setBackgroundImage(UIImage(named: backgroundImageName+"_highlighted"), for: UIControlState.highlighted)
        
        sizeToFit()
    }
    
}
